﻿<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link type="text/css" href="../Layui/css/layui.css" rel="stylesheet" media="all">
    <script type="text/javascript" src="../Htc/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="../Layui/layui.js"></script>
    <style>
        .layui-laypage .layui-laypage-curr .layui-laypage-em {
            background-color: #1E9FFF;
        }

        .layui-text em, .layui-word-aux {
            color: #fff !important;
            padding: 0 0px !important
        }
    </style>
</head>
<body>
    <form id="form1" class="layui-form">
        <div class="poppan" style="padding:10px;">
            <table style="width:100%;">
                <tr>
                    <td class="site-content">   <h1 class="layui-text">上传导入</h1></td>
                    <td class="site-content">   <h1 class="layui-text"> 导入预览</h1></td>
                </tr>
            </table>

            <div class="layui-progress">
                <div class="layui-progress-bar" lay-percent="100%"></div>
            </div>
            <div class="site-content" style="margin-top:10px; margin-left:10px;">
                <ul class="layui-timeline">
                    <li class="layui-timeline-item">
                        <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
                        <div class="layui-timeline-content layui-text">
                            <h3 class="layui-timeline-title">学员信息</h3>
                            <div class="layui-card-body">
                                <h6 class="layui-timeline-title">
                                    @if (ViewBag.ResultData.code == "0000")
                                    {
                                        <font>名单总数：<label>@ViewBag.ResultData.data["count"]</label></font>
                                        <font>失败总数：<label class="layui-badge">@ViewBag.ResultData.data["overCount"]</label></font>
                                    }
                                    else
                                    {
                                        <font>错误信息：<label class="layui-badge">@ViewBag.ResultData.message</label></font>
                                    }
                                </h6>
                                <table class="layui-table" lay-filter="importData">
                                    <thead>
                                        <tr>
                                            <th lay-data="{field:'error',style:'color:red',width:150,sort:true}">错误信息</th>
                                            <th lay-data="{field:'CustName',sort:true}">宝宝姓名</th>
                                            <th lay-data="{field:'ChildName'}">宝宝小名</th>
                                            <th lay-data="{field:'BirdDate',sort:true}">出生生日</th>
                                            <th lay-data="{field:'Sex',sort:true}">性别</th>
                                            <th lay-data="{field:'LinkName',sort:true}">妈妈</th>
                                            <th lay-data="{field:'CustTel1',sort:true}">妈妈手机号码</th>
                                            <th lay-data="{field:'LinkName1'}">爸爸</th>
                                            <th lay-data="{field:'CustTel1'}">爸爸手机号码</th>
                                            <th lay-data="{field:'WeiXin'}">微信号</th>
                                            <th lay-data="{field:'Gddh'}">固定电话</th>
                                            <th lay-data="{field:'Address'}">地址</th>
                                            <th lay-data="{field:'MarketName',sort:true}">市场人员</th>
                                            <th lay-data="{field:'IntentionCourse',sort:true}">意向课程</th>
                                            <th lay-data="{field:'IntentionDate'}">意向时间</th>
                                            <th lay-data="{field:'Importance',sort:true}">重要程度</th>
                                        </tr>
                                    </thead>
                                    @if (ViewBag.ResultData.code == "0000")
                                    {
                                        foreach (var dr in ViewBag.ResultData.data["data"].Rows)
                                        {
                                            <tr>
                                                <td>@dr["error"]</td>
                                                <td>@dr["CustName"]</td>
                                                <td>@dr["ChildName"]</td>
                                                <td>@dr["BirdDate"]</td>
                                                <td>@dr["Sex"]</td>
                                                <td>@dr["LinkName"]</td>
                                                <td>@dr["CustTel"]</td>
                                                <td>@dr["LinkName1"]</td>
                                                <td>@dr["CustTel1"]</td>
                                                <td>@dr["WeiXin"]</td>
                                                <td>@dr["Gddh"]</td>
                                                <td>@dr["Address"]</td>
                                                <td>@dr["MarketName"]</td>
                                                <td>@dr["IntentionCourse"]</td>
                                                <td>@dr["IntentionDate"]</td>
                                                <td>@dr["Importance"]</td>
                                            </tr>
                                        }
                                    }
                                </table>
                            </div>
                        </div>
                    </li>

                    <li class="layui-timeline-item">
                        <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
                        <div class="layui-timeline-content layui-text">
                            <div class="layui-timeline-title">导入完毕</div>
                        </div>
                        <div>
                            <a href="../Customer/Import" class="layui-btn layui-btn-normal ">　上一步　</a>
                            @if (ViewBag.ResultData.code == "0000")
                            {
                                <a href="javascript:Finish()" class="layui-btn layui-btn-normal ">　确定导入　</a>
                            }
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </form>

    <script>
        var file = "";
        layui.use(['element', 'table', 'layer', 'laypage', 'form', 'laydate', 'upload'], function () {
            layui.table.init('importData', {
                height: 315,
                cellMinWidth: 100,
                page: true,
                limits: [10, 20, 50, 100],
                limit: @ViewBag.PageSize
            });

        });
        function Finish() {
            $.ajax({
                type: 'POST',
                url: "../Customer/Import1/Finish",
                dataType: "json",
                success: function (data) {
                    if (data.code == "0000") {
                        layui.layer.msg("导入成功", {
                        }, function () {
                            parent.location.reload();
                            });
                    } else
                        layui.layer.msg(data.message);
                }
            });
        }

    </script>

</body>
</html>